import { getRandomDateTime, getNowDate, getFeatureDate } from '../../../utils'
import Mock from 'mockjs'
export const errorLogMock = pageSize => {
  const result: any[] = []
  for (let i = 0; i < pageSize; i++) {
    result.push({
      id: i + 1,
      traceId: Mock.Random.word(5, 12),
      userId: Mock.mock('@natural(1, 1000)'),
      userType: Mock.mock('@natural(1, 2)'),
      applicationName: Mock.mock('@word'),
      'requestMethod|1': ['post', 'get', 'delete', 'put'],
      requestParams: Mock.Random.word(5, 12),
      requestUrl: Mock.mock('@url'),
      userIp: Mock.Random.ip(),
      'userAgent|1': ['google', 'edge', 'ie', 'mac'],
      exceptionTime: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      exceptionName: Mock.mock('@word'),
      exceptionMessage: Mock.mock('@csentence()'),
      exceptionRootCauseMessage: Mock.mock('@csentence()'),
      exceptionStackTrace: Mock.Random.word(5, 12),
      exceptionClassName: Mock.Random.word(5, 12),
      exceptionFileName: Mock.Random.word(5, 12),
      'exceptionMethodName|1': ['post', 'get', 'delete', 'put'],
      exceptionLineNumber: Mock.mock('@natural(1, 1000)'),
      processUserId: Mock.mock('@natural(1, 1000)'),
      processStatus: Mock.mock('@integer(0, 2)'),
      processTime: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      resultCode: Mock.mock('@natural(1, 1000)'),
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    })
  }
  return result
}
